﻿using MediatR;
using Traceability.Commont.Domains.ScratchTheFat;
using Traceability.Commont.DTOs.CommontFiles;
using Traceability.Commont.Infrastructures.Interfaces;
namespace U.Enterprise.Api.Applications.LoginNEwSheet
{
    public class ApproachInspectionHtmlHandler : IRequestHandler<ApproachInspectionHtmlCommond, Resqults>
    {


        private readonly IBateRepository<ApproachInspectionSheet> _ApproachInspectionSheet;

        public ApproachInspectionHtmlHandler(IBateRepository<ApproachInspectionSheet> approachInspectionSheet)
        {
            _ApproachInspectionSheet = approachInspectionSheet;
        }
        public async Task<Resqults> Handle(ApproachInspectionHtmlCommond request, CancellationToken cancellationToken)
        {

            try
            {
                var list = new Resqults() { Code = 0 };

                list.Date = _ApproachInspectionSheet.GetAll();

                return list;

            }
            catch (Exception)
            {

                throw;
            }
          
           

        }
    }
}
